package bairui.international.model.domain.jpa;

/**
 *
 * @see TB_IndexModuleProduct 首页模块产品
 *
 */
public class TestData_TB_IndexModuleProduct
{

	private final static org.apache.commons.text.RandomStringGenerator Generator = new org.apache.commons.text.RandomStringGenerator.Builder().withinRange(new char[][]{{'a','z'}, {'A','Z'}, {'0','9'}}).build();

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_IndexModuleProduct saveMust(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.id.ID_IndexModuleProduct id
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_IndexModuleProduct");
		return (TB_IndexModuleProduct)repository.save(newMust(
				id
			));
	}
	
	public static TB_IndexModuleProduct newMust(
		bairui.international.model.domain.jpa.id.ID_IndexModuleProduct id
	){
		return new TB_IndexModuleProduct(new TB_IndexModuleProduct.MustProperties() {
			@Override public bairui.international.model.domain.jpa.id.ID_IndexModuleProduct getId(){
				return id;
			}
			/** 状态 */
			@Override public com.sh_lianjing.model.status.State_UpDown getState(){
				return com.sh_lianjing.model.status.State_UpDown.Downed;
			}
		});
	}
	

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_IndexModuleProduct saveAll(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.id.ID_IndexModuleProduct id
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_IndexModuleProduct");
		return (TB_IndexModuleProduct)repository.save(newAll(
				id
			));
	}
	
	public static TB_IndexModuleProduct newAll(
		bairui.international.model.domain.jpa.id.ID_IndexModuleProduct id
	){
		return new TB_IndexModuleProduct(
			new TB_IndexModuleProduct.MustProperties() {
				@Override public bairui.international.model.domain.jpa.id.ID_IndexModuleProduct getId(){
					return id;
				}
				/** 状态 */
				@Override public com.sh_lianjing.model.status.State_UpDown getState(){
					return com.sh_lianjing.model.status.State_UpDown.Downed;
				}
			},
			new TB_IndexModuleProduct.OptionalSingleProperties() {
				/** 说明 */
				@Override public String getComment(){
					return Generator.generate(0, 255);
				}
			}
		);
	}
	

}
